Home / Data table / Update row

Data table ‐ Update row


Update a specific record in a api data table. A api data table is a table where the option is enables to change the data table trough the api.

Endpoint

PUT /api/datatable/update/:dataTable/:id

Parameters

  • :dataTable (string) - name of the table within which the search is done
  • :id (string) - value of the primary key of the row that's gonna be updated

Headers

see Using authentication token

Payload

Payload should be JSON object with the data of the updated row. It doesn't have to containing all the fields of the row, just the ones that are ought to be updated.Value of the primary key cannot be changed.

Response

        {
          "valid": true,
          "data": null
        }

Example code:

<?php

require_once 'RestOpen.php';

$username = 'my_username';
$password = 'my_password';
$workspaceId = 999;
$tableName = 'your_table_name';
$primaryKey = 'primary_key_to_search';
$updateColumns = array(
'column_name_1'=>'column_value_1',
'column_name_2'=>'column_value_2'
);

$rest = new RestOpen($username, $password, $workspaceId);
$result = $rest->putDataTableUpdateRow($tableName, $primaryKey, $updateColumns);

var_dump($result);